package com.opennews.openplatform

import groovy.transform.CompileStatic
import org.springframework.messaging.simp.SimpMessageSendingOperations

@CompileStatic
class FooController {
    SimpMessageSendingOperations brokerMessagingTemplate

    def index() {
        brokerMessagingTemplate.convertAndSend("/topic/greetings", [
            timestamp: new Date().toTimestamp(),
            msg: "Pushed from server",
        ])

        render("Message pushed from FooController")
    }
}